package com.eleclab.modele;

import com.eleclab.traitement.Complexe;

/* TODO
 * - Ajouter les attributs
 * - Ajouter constructeur, setters, getters
 */

public class Resistance extends Composant{
    
    float resist;
    
    public Resistance(String aNom, int ax,int ay, float aResistance, char aOrientation) {
        super(aNom,"resistance",ax,ay, aOrientation, "res");
        this.resist=aResistance;
        calculImpedance();
    }
    
    public  float getValeur(){
        return resist;
    }
    
    public  void setValeur(float newValeur){
        if(newValeur>0){
            resist=newValeur;
        } else {
            System.out.println("resistance non positive!");
            
        }
    }
    public void calculImpedance(){
        this.impedance=new Complexe(resist,0);
    }
    
    public Complexe calculImpedanceGraph(float w){
        return new Complexe (resist, 0);
    }
    
}
